package com.hb.controller;

import com.hb.entity.Address;
import com.hb.mapper.AddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hubin
 * @description
 * @createTime 2024/3/8 15:56
 */
@RestController
@RequestMapping("/address")
public class AddressController {

    @Autowired
    private AddressMapper addressMapper;

    @PostMapping("/insert")
    public Address insert(Address address) {
        addressMapper.insert(address);
        return address;
    }

    @PostMapping("/batchInsert")
    public List<Address> batchInsert(List<Address> addressList) {
        addressMapper.batchInsert(addressList);
        return addressList;
    }
}
